/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function show_confirm()
{
    var r=confirm("Values are entered, Do you want to Continue? ");
    if (r==true)
    {
        calculate();
    }
    else
    {
        alert("Good Bye!");
    }
}
function calculate()
{
    //alert("I am in display function!");
    var num1 = document.getElementById("in1");
    var num2 = document.getElementById("in2");
    var num3 = document.getElementById("in3");
    if (isNaN(num1.value) ||  isNaN(num2.value) || isNaN(num3.value))
    {
        alert("Sorry You Should have inserted Numbers NOT Strings");
    }
    else if((num1.value != "") && (num2.value != "") && (num3.value != "") )
    {
        //  alert("inside calculate");
        var sum_s = document.getElementById("sums");
        sum_s.value = Number(num1.value) + Number(num2.value) + Number(num3.value);
        // alert(sum_s.value);
        var avgg_s = document.getElementById("avgg");
        avgg_s.value = (Number(num1.value)+ Number(num2.value) + Number(num3.value))/3;
        // alert(avgg_s.value);
        var prod_s = document.getElementById("prod");
        prod_s.value = num1.value * num2.value * num3.value;
        //alert(prod_s.value);
        var minimum = document.getElementById("minn");
        minimum.value = Math.min(num1.value,num2.value,num3.value);
        // alert(minimum.value);
        var maximum = document.getElementById("maxx");
        maximum.value = Math.max(num1.value,num2.value,num3.value);
    //alert(maximum.value);
    }  
    else
    {
        alert("Sorry You Should have inserted a Number not null Or Empty Field");
    }
         
} 
	
